import requests
url = 'http://www.baidu.com'
f = requests.get(url)
#print(f.status_code)
f.encoding ='utf-8'
html = f.text

# print(html)
print(f.url)
print(f.headers)
print(f.encoding)